#include <QApplication>
#include "headers/mainwindow.h"
#include <QScreen>

int main(int argc, char *argv[]) {
    qDebug() << "程序开始启动...";
    QApplication a(argc, argv);
    MainWindow window;
    window.show();

//    qDebug() << "边框几何信息"<<Qt::endl
//    << "x:"<<window.x()<<Qt::endl
//    << "y:"<<window.y()<<Qt::endl
//    << "x:"<<window.frameGeometry().x()<<Qt::endl
//    << "y:"<<window.frameGeometry().y()<<Qt::endl
//    << "width:"<<window.width()<<Qt::endl
//    << "height:"<<window.height()<<Qt::endl
//    << "pos:" << window.pos();
//    qDebug() << "客户区几何信息"<<Qt::endl
//             << "x:"<<window.geometry().x()<<Qt::endl
//             << "y:"<<window.geometry().y()<<Qt::endl
//             << "widht:"<<window.width()<<Qt::endl
//             << "height:"<<window.height()<<Qt::endl
//             << "width:"<<window.geometry().width()<<Qt::endl
//             << "height:"<<window.geometry().height()<<Qt::endl
//             << "pos:" << window.pos();
    QIcon icon("../../base-frameless-window/src/resources/images/logo.png");
    QApplication::setWindowIcon(icon);
    QScreen *screen = QGuiApplication::primaryScreen();//获取主屏
    QRect rect = screen->availableGeometry();
    window.resize(QSize(rect.size().width() * 0.8, rect.size().height() * 0.8));
    window.move((rect.size().width() - window.width()) / 2, 100);
    window.setWindowTitle("无边框窗口程序");
    qDebug() << "程序动完成...";
    return QApplication::exec();
}